import request from '@/config/axios'

/** 密钥充值记录信息 */
export interface SecretRechargeRecord {
          id: number; // ID
          rechargeTenantId?: number; // 租户ID
          secretId?: number; // 对应的密钥ID
          rechargeAmount?: number; // 充值金额(元)
          beforeBalance?: number; // 充值前余额(元)
          afterBalance?: number; // 充值后余额(元)
          remark: string; // 备注
  }

// 密钥充值记录 API
export const SecretRechargeRecordApi = {
  // 查询密钥充值记录分页
  getSecretRechargeRecordPage: async (params: any) => {
    return await request.get({ url: `/vos/secret-recharge-record/page`, params })
  },

  // 查询密钥充值记录详情
  getSecretRechargeRecord: async (id: number) => {
    return await request.get({ url: `/vos/secret-recharge-record/get?id=` + id })
  },

  // 新增密钥充值记录
  createSecretRechargeRecord: async (data: SecretRechargeRecord) => {
    return await request.post({ url: `/vos/secret-recharge-record/create`, data })
  },

  // 修改密钥充值记录
  updateSecretRechargeRecord: async (data: SecretRechargeRecord) => {
    return await request.put({ url: `/vos/secret-recharge-record/update`, data })
  },

  // 删除密钥充值记录
  deleteSecretRechargeRecord: async (id: number) => {
    return await request.delete({ url: `/vos/secret-recharge-record/delete?id=` + id })
  },

  /** 批量删除密钥充值记录 */
  deleteSecretRechargeRecordList: async (ids: number[]) => {
    return await request.delete({ url: `/vos/secret-recharge-record/delete-list?ids=${ids.join(',')}` })
  },

  // 导出密钥充值记录 Excel
  exportSecretRechargeRecord: async (params) => {
    return await request.download({ url: `/vos/secret-recharge-record/export-excel`, params })
  },
}
